<?php include ('includes/header.php');?>
<?php include ('includes/db_connect.php');?>
<?php
    $sql = "SELECT * FROM categories WHERE id = '".$_GET['id']."'";
    $query = mysql_query($sql);
    $data = mysql_fetch_array($query);
?>

            <div class="row">
                <div class="col-lg-12">
                    <h1 class="page-header"><?php echo $data['name'] ?></h1>
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->
            <div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-default">
                        <div class="panel-body">
                            <div class="row">
                                <div class="col-lg-6">
                                    <form action="categories_act.php?act=2" method="POST" role="form">

                                        <input type="hidden" name="id" value="<?php echo $data['id']; ?>">
                                    
                                        <div class="form-group">
                                            <label for="name">Category Name</label>
                                            <input type="text" class="form-control" id="name" name="name" placeholder="Category Name" value="<?php echo $data['name']; ?>">
                                        </div>
                                    
                                        <button type="submit" class="btn btn-primary">Submit</button>
                                    </form>
                                </div>
                                <!-- /.col-lg-6 (nested) -->
                            </div>
                            <!-- /.row (nested) -->
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <!-- /.panel -->
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->
        
<?php include ('includes/footer.php');?>